import {
  PET_STATE_LIST,
  IS_CLOSE_CHILDREN_LIST,
  IS_CLOSE_OTHER_PET_LIST,
} from '@/const/type';
export const tableOption = () => {
  return {
    ...window.$crudMixins.tableOptions,
    addBtn: false,
    editBtn: false,
    delBtn: false,
    menuWidth: 260,
    labelWidth: 140,
    emptyBtn: false,
    submitBtn: false,
    column: [
      {
        label: '宠物快照233',
        prop: 'avatar',
        type: 'upload',
        listType: 'picture-img',
        fileType: 'img', //img/video/audio
        span: 12,
        fileSize: 5 * 1024,
        propsHttp: {
          name: 'hash',
          url: 'key',
        },
        oss: 'qiniu',
        cropperOption: {
          enlarge: 2,
          fixed: true,
          fixedNumber: [0.75, 1],
        },
        tip: '请上传jpg/png/jpeg/webp/heic类型的文件，最大可上传5M',
        accept: '.jpg,.png,.jpeg,.webp,.heic',
        limit: 1,
      },
      {
        label: '宠物昵称',
        prop: 'username',
        search: true,
        rules: [
          {
            required: true,
            message: '请输入宠物昵称',
          },
          {
            min: 2,
            max: 20,
            message: '长度在 2 到 20 个字符',
            trigger: 'blur',
          },
        ],
      },
      {
        type: 'select',
        label: '性别',
        prop: 'nickname',
        rules: [
          {
            required: true,
            message: '请选择宠物性别',
          },
        ],
        dicData: [],
      },
      {
        label: '宠物品种',
        prop: 'type',
        search: true,
        type: 'cascader',
        dicData: [
          {
            label: '猫咪',
            value: 'CAT',
            parent: '0',
            children: [
              {
                label: '布偶猫',
                value: 'BUOU',
                parent: 'CAT',
              },
              {
                label: '加菲猫',
                value: 'JIAFEI',
                parent: 'CAT',
              },
              {
                label: '金吉拉',
                value: 'JINJILA',
                parent: 'CAT',
              },
              {
                label: '缅因猫',
                value: 'MIANYIN',
                parent: 'CAT',
              },
              {
                label: '美国短毛猫',
                value: 'DUANMAO',
                parent: 'CAT',
              },
              {
                label: '苏格兰折耳猫',
                value: 'ZHEER',
                parent: 'CAT',
              },
              {
                label: '暹罗猫',
                value: 'XIANLUO',
                parent: 'CAT',
              },
              {
                label: '中华田园猫',
                value: 'TIANYUAN',
                parent: 'CAT',
              },
              {
                label: '奥西猫',
                value: 'AOXI',
                parent: 'CAT',
              },
              {
                label: '阿比西尼亚猫',
                value: 'ABIXINIYA',
                parent: 'CAT',
              },
              {
                label: '阿舍拉猫',
                value: 'ASHELA',
                parent: 'CAT',
              },
              {
                label: '澳大利亚雾猫',
                value: 'WU',
                parent: 'CAT',
              },
              {
                label: '伯曼猫',
                value: 'BOMAN',
                parent: 'CAT',
              },
              {
                label: '巴厘猫',
                value: 'BALI',
                parent: 'CAT',
              },
              {
                label: '波斯猫',
                value: 'BOSI',
                parent: 'CAT',
                children: null,
              },
              {
                label: '波米拉猫',
                value: 'BOMILA',
                parent: 'CAT',
                children: null,
              },
            ],
          },
          {
            label: '狗狗',
            value: 'DOG',
            parent: '0',
          },
        ],
      },
      {
        type: 'select',
        label: '驱虫情况',
        prop: 'nickname',
        rules: [
          {
            required: true,
            message: '请选择驱虫情况',
          },
        ],
        dicData: [],
      },
      {
        type: 'select',
        label: '绝育情况',
        prop: 'nickname',
        rules: [
          {
            required: true,
            message: '请选择绝育情况',
          },
        ],
        dicData: [],
      },
      {
        type: 'select',
        label: '疫苗情况',
        prop: 'nickname',
        rules: [
          {
            required: true,
            message: '请选择疫苗情况',
          },
        ],
        dicData: [],
      },
      {
        label: '收养来源',
        prop: 'userId',
        type: 'select',
        dicData: PET_STATE_LIST,
        rules: [
          {
            required: true,
            message: '请选择收养来源',
          },
        ],
      },
      {
        label: '项圈编号',
        prop: 'code',
        search: true,
        rules: [
          {
            required: true,
            message: '请输入项圈编号',
          },
        ],
      },
      {
        label: '所属爱心收容站',
        prop: 'userId',
        search: true,
        type: 'select',
        dicData: PET_STATE_LIST,
        rules: [
          {
            required: true,
            message: '请选择所属爱心收容站',
          },
        ],
      },
      {
        label: '收容站位置',
        prop: 'userId',
        detail: true,
      },
      {
        label: '出生日期',
        prop: 'createTime',
        type: 'date',
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd',
        rules: [
          {
            required: true,
            message: '请选择出生日期',
          },
        ],
      },
      {
        label: '年龄段',
        prop: 'createTime',
        type: 'select',
        rules: [
          {
            required: true,
            message: '请选择年龄段',
          },
        ],
      },
      {
        label: '收养日期',
        prop: 'createTime',
        type: 'datetime',
        format: 'yyyy-MM-dd',
        valueFormat: 'yyyy-MM-dd',
        search: true,
        width: 160,
        searchRange: true,
        rules: [
          {
            required: true,
            message: '请选择收养日期',
          },
        ],
      },
      {
        label: '性格标签',
        prop: 'createTime',
        type: 'select',
        rules: [
          {
            required: true,
            message: '请选择性格标签',
          },
        ],
        // multiple: true,
      },
      {
        label: '体型',
        prop: 'createTime',
        type: 'select',
        rules: [
          {
            required: true,
            message: '请选择体型',
          },
        ],
      },
      {
        label: '体重（kg）',
        prop: 'createTime',
        rules: [
          {
            required: true,
            message: '请输入体重',
          },
        ],
      },
      {
        label: '毛色',
        prop: 'createTime',
        type: 'select',
        rules: [
          {
            required: true,
            message: '请选择毛色',
          },
        ],
      },
      {
        label: '毛发长度',
        prop: 'createTime',
        type: 'select',
        rules: [
          {
            required: true,
            message: '请选择毛发长度',
          },
        ],
      },
      {
        label: '是否亲近儿童',
        prop: 'code',
        type: 'radio',
        dicData: IS_CLOSE_CHILDREN_LIST,
        rules: [
          {
            required: true,
            message: '请选择是否亲近儿童',
          },
        ],
      },
      {
        label: '是否亲近其他宠物',
        prop: 'code',
        type: 'radio',
        dicData: IS_CLOSE_OTHER_PET_LIST,
        rules: [
          {
            required: true,
            message: '请选择是否亲近其他宠物',
          },
        ],
      },
      {
        label: '其他特征',
        prop: 'createTime',
        type: 'select',
        rules: [
          {
            required: true,
            message: '请选择其他特征',
          },
        ],
      },
      {
        label: '备注',
        prop: 'remark',
        type: 'textarea',
        rules: [
          {
            required: true,
            message: '请输入备注',
          },
        ],
        span: 24,
      },
    ],
  };
};
